import request from '@/utils/request'

// 获取列表
export function getNewsListApi(data) {
  return request({
    url: 'news',
    method: 'get',
    params: data
  })
}

// 获取
export function getNewsInfoApi(id, data) {
  return request({
    url: `news/${id}`,
    method: 'get',
    data
  })
}

// 删除新闻
export function delNewsApi(ids) {
  return request({
    url: `news/${ids}`,
    method: 'delete'
  })
}

// 修改新闻
export function updateNewsApi(id, data) {
  return request({
    url: `news/${id}`,
    method: 'put',
    data
  })
}

// 保存新闻
export function addNewsApi(data) {
  return request({
    url: 'news',
    method: 'post',
    data
  })
}